<template>
    <div class="classPaper">
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="学生风采" name="schoolAlbum">
                <el-row v-if="!isDetailShow">
                    <el-col :span="24">
                        <div class="content clearFix">
                            <div class="imgList" v-for="item in 4" :key="item" @click="isDetailShow=true">
                                <div class="imgWarp">
                                    <el-image :src="src">
                                        <div slot="placeholder" class="image-slot">
                                            加载中<span class="dot">...</span>
                                        </div>
                                        <div slot="error" class="image-slot">
                                            <i class="el-icon-picture-outline"></i>
                                        </div>
                                    </el-image>
                                </div>
                                <div class="imgName">
                                    <label>枯木会逢春</label>
                                </div>
                            </div>
                        </div>
                    </el-col>
                </el-row >
                <div class="block" v-if="!isDetailShow">
                    <el-pagination
                            background
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="currentPage"
                            :page-sizes="[100, 200, 300, 400]"
                            :page-size="100"
                            layout="total, sizes, prev, pager, next, jumper"
                            :total="400">
                    </el-pagination>
                </div >
                <ClassArticleDetail v-if="isDetailShow" :activeIndex="2"></ClassArticleDetail>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>

<script>
    import ClassArticleDetail from '@c/article/classArticleDetail'
    export default {
        components:{
            ClassArticleDetail
        },
        data() {
            return {
                activeName: 'schoolAlbum',
                currentPage:1,
                src:require('../../../assets/img/headportrait01.jpg'),
                isDetailShow:false
            };
        },
        methods: {
            handleClick(tab, event) {
                console.log(tab, event);
            },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            }
        }
    }
</script>

<style lang="scss" scoped>
.classPaper{
    background-color: white;
    box-sizing: border-box;
    padding: 0 10px;
    min-height: 70vh;
    .imgList{
        float: left;
        margin-right: 10px;
        margin-bottom: 10px;
        .imgWarp{
            width: 190px;
            height: 190px;
        }
        .imgName{
            font-size: 14px;
            color: #303133;
            margin-top: 5px;
        }
    }
    .block{
        margin-top: 20px;
    }

    .clearFix::after{
        content: "";
        display: block;
        width: 100%;
        font-size: 0;
        clear: both;
    }
}
</style>